
/* Bring in data from 1_Data_Cleaning.do */
clear all
use "data/outputs/clean_mm.dta", clear 


**------------------------------------**
** Does Partisanship Affect Support?? **
**------------------------------------**


/* create an indicator for sample (non-missing across all three outcomes: diff, support and consisistency) */
gen sample2 =0
replace sample2=1 if copartisan!=. & exp2_support!=. & exp2_consistent!=.


/* Makes SUPPORT outcome variable binary */
gen exp2_support_binary = 0 if exp2_support >= 1 & exp2_support <= 2
replace exp2_support_binary = 1 if exp2_support >= 3 & exp2_support <= 4

label variable exp2_support_binary "Support governor's plan?"
label define exp2_support_binaryl 1 "Support Plan", replace
label define exp2_support_binaryl 0 "Oppose Plan", add
label values exp2_support_binary exp2_support_binaryl


/* Makes CONSISTENT outcome variable binary */
gen exp2_consistent_binary = 0 if exp2_consistent >= 1 & exp2_consistent <= 2
replace exp2_consistent_binary = 1 if exp2_consistent >= 3 & exp2_consistent <= 4

label variable exp2_consistent_binary "Governor's plan democratic?"
label define exp2_consistent_binaryl 1 "Consistent w/ democracy", replace
label define exp2_consistent_binaryl 0 "Inconsistent w/ democracy", add
label values exp2_consistent_binary exp2_consistent_binaryl


/* follow PAP */
gen Diff = exp2_support - exp2_consistent
gen Diff_binary = exp2_support_binary - exp2_consistent_binary


/* DV: support MINUS consistency */
eststo exp21: regress Diff copartisan if sample2==1, robust
eststo exp22: regress Diff copartisan if exp2_attention == 1 & sample2==1, robust
eststo exp23: regress Diff_binary copartisan if sample2==1, robust
eststo exp24: regress Diff_binary copartisan if exp2_attention == 1 & sample2==1, robust


/* DV: Support policy irrespective of attitudes toward consistency? */
eststo exp25: regress exp2_support copartisan if sample2==1, robust
eststo exp26: regress exp2_support copartisan if exp2_attention == 1 & sample2==1, robust
eststo exp27: regress exp2_support_binary copartisan if sample2==1, robust
eststo exp28: regress exp2_support_binary copartisan if exp2_attention == 1 & sample2==1, robust


/* DV: Think it is consistent with democracy irrespective of support? */
eststo exp29: regress exp2_consistent copartisan if sample2==1, robust
eststo exp30: regress exp2_consistent copartisan if exp2_attention == 1 & sample2==1, robust
eststo exp31: regress exp2_consistent_binary copartisan if sample2==1, robust
eststo exp32: regress exp2_consistent_binary copartisan if exp2_attention == 1 & sample2==1, robust


/* Table with binary DVs */
esttab exp23 exp24 exp27 exp28 exp31 exp32 /*
*/ using "outputs/Table1.tex", b(3) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) /*
*/ keep (copartisan _cons) /*
*/ mgroups("\textbf{Difference}" "\textbf{Support Act}" "\textbf{Consistent}" , pattern(1 0 1 0 1 0 ) /*
*/ span prefix(\multicolumn{@span}{c}{) suffix(}) erepeat(\cmidrule(lr){@span})) nomtitles /*
*/ varlabels(copartisan "Own-party governor" /*
*/ _cons "Constant (Out-party mean)") se r2 label replace


/* Table with continuous DVs */
esttab exp21 exp22 exp25 exp26 exp29 exp30 /*
*/ using "outputs/Appendix_Table13.tex", b(3) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) /*
*/ keep (copartisan _cons) /*
*/ mgroups("\textbf{Difference}" "\textbf{Support Act}" "\textbf{Consistent}" , pattern(1 0 1 0 1 0 ) /*
*/ span prefix(\multicolumn{@span}{c}{) suffix(}) erepeat(\cmidrule(lr){@span})) nomtitles /*
*/ varlabels(copartisan "Own-party governor" /*
*/ _cons "Constant (Out-party mean)") se r2 label replace


/* End */
